Skip to content

feat: add integration testing infrastructure and coverage reporting#85

Merged
joshsmithxrm merged 9 commits intomainfrom
feature/integration-testing
Jan 2, 2026
Merged

feat: add integration testing infrastructure and coverage reporting#85
joshsmithxrm merged 9 commits intomainfrom
feature/integration-testing

Conversation

@joshsmithxrm
Copy link
Copy Markdown
Owner

Summary

Changes

Integration Testing Infrastructure (#55 Phase 1)

Project Purpose
PPDS.Dataverse.IntegrationTests FakeXrmEasy v3.8.0 for mocked Dataverse tests
PPDS.Auth.IntegrationTests Authentication flow validation
PPDS.LiveTests Live Dataverse connection tests with skip logic

Key components:

  • FakeXrmEasyTestsBase - Base class with middleware builder (RPL-1.5 license)
  • LiveTestBase - Base class with [Trait("Category", "Integration")] for filtering
  • SkipIfNoCredentialsAttribute - Skips tests when credentials unavailable
  • integration-tests.yml - Approach B workflow (trusted PRs get integration tests)

Code Coverage (#84)

  • Updated test.yml to collect coverage with --collect:"XPlat Code Coverage"
  • Added codecov.yml with per-package thresholds (informational only)
  • Added Codecov upload action

Baseline coverage:

Package Current Target
PPDS.Plugins 100% 95%
PPDS.Dataverse 38% 60%
PPDS.Cli 12% 60%
PPDS.Auth 0% 70%
PPDS.Migration 0% 50%

Pre-commit Hook Fix

  • Changed matcher to only fire on git commit commands
  • Fixed Windows path issue with $CLAUDE_PROJECT_DIR

Test plan

  • All existing tests pass
  • FakeXrmEasy smoke tests pass (CRUD operations verified)
  • LiveTests correctly filtered out when no credentials
  • Build succeeds with --warnaserror

Next Steps

After merge:

🤖 Generated with Claude Code

joshsmithxrm and others added 3 commits January 2, 2026 01:23
Add three new test projects for comprehensive integration testing:

- PPDS.Dataverse.IntegrationTests: FakeXrmEasy v3.8.0 for mocked Dataverse tests
- PPDS.Auth.IntegrationTests: Authentication flow validation
- PPDS.LiveTests: Live Dataverse connection tests with skip logic

Infrastructure includes:
- FakeXrmEasyTestsBase with middleware builder (RPL-1.5 license)
- LiveTestBase with [Trait("Category", "Integration")] for filtering
- SkipIfNoCredentials attributes for graceful credential handling
- LiveTestConfiguration reading from environment variables

CI/CD changes:
- integration-tests.yml: Approach B workflow (trusted PRs get integration tests)
- test.yml: Updated to exclude integration tests with --filter
- dependabot.yml: Added fakexrmeasy group for package updates

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add coverage collection and Codecov integration for visibility into
test coverage across all packages.

Changes:
- test.yml: Add --collect:"XPlat Code Coverage" and Codecov upload
- codecov.yml: Per-package thresholds matching issue #55 targets
- .gitignore: Exclude coverage/ directory

Per-package targets (informational only, no PR blocking):
- PPDS.Plugins: 95% (currently 100%)
- PPDS.Auth: 70% (currently 0% - no tests)
- PPDS.Dataverse: 60% (currently 38%)
- PPDS.Migration: 50% (currently 0% - no tests)
- PPDS.Cli: 60% (currently ~12%)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Change matcher from "Bash" to "Bash(git commit:*)" so hook only
  fires on commit commands, not every Bash invocation
- Use relative path instead of $CLAUDE_PROJECT_DIR which wasn't
  expanding correctly on Windows
- Simplify Python script since matcher now handles filtering

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings January 2, 2026 08:06
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @joshsmithxrm, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the project's testing capabilities by laying the groundwork for robust integration tests and introducing automated code coverage analysis. It also includes a crucial fix for the pre-commit hook, improving developer experience, especially on Windows. These changes collectively aim to improve code quality, reliability, and maintainability by providing better feedback mechanisms for new and existing code.

Highlights

  • Integration Testing Infrastructure: Introduced a comprehensive integration testing setup, including mocked Dataverse tests with FakeXrmEasy, authentication flow validation tests, and live Dataverse connection tests with skip logic for missing credentials. This is Phase 1 of issue Add comprehensive integration testing infrastructure #55.
  • Code Coverage Reporting: Implemented Codecov for automated code coverage reporting, integrating it into the CI/CD pipeline. This includes a new codecov.yml configuration with per-package thresholds and an upload action, addressing issue Add code coverage reporting with Codecov #84.
  • Pre-commit Hook Fix: Resolved issues with the pre-commit hook on Windows by adjusting the matcher in settings.json to specifically target git commit commands and fixing a Windows path compatibility problem with $CLAUDE_PROJECT_DIR.
Ignored Files
  • Ignored by pattern: .github/workflows/** (2)
    • .github/workflows/integration-tests.yml
    • .github/workflows/test.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@joshsmithxrm joshsmithxrm moved this from Todo to In Progress in PPDS Roadmap Jan 2, 2026
@joshsmithxrm joshsmithxrm self-assigned this Jan 2, 2026
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a comprehensive integration testing infrastructure and code coverage reporting, which are excellent additions for improving project quality and maintainability. The structure with different test projects for mocked, auth, and live tests is well-designed. The pre-commit hook has also been nicely simplified. My review focuses on a few areas in the new test code to improve resource management, reduce code duplication, and strengthen test assertions. Overall, this is a solid contribution.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements Phase 1 of integration testing infrastructure along with code coverage reporting. It adds three new test projects for different testing scenarios (FakeXrmEasy mocked tests, authentication tests, and live Dataverse tests), updates CI workflows to collect coverage and run integration tests, and configures Codecov for coverage tracking.

Key changes:

  • Three new test projects with infrastructure for mocked Dataverse tests (FakeXrmEasy), authentication validation, and live environment tests with conditional skip logic
  • CI/CD enhancements: coverage collection in test.yml, new integration-tests.yml workflow for trusted PRs, and Codecov configuration with per-package thresholds
  • Pre-commit hook refinements to fix Windows path issues and improve command filtering

Reviewed changes

Copilot reviewed 17 out of 18 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/PPDS.LiveTests/PPDS.LiveTests.csproj New test project for live Dataverse connection tests
tests/PPDS.LiveTests/LiveDataverseSmokeTests.cs Smoke tests validating live test infrastructure and credential detection
tests/PPDS.LiveTests/Infrastructure/SkipIfNoCredentialsAttribute.cs Custom xUnit attributes to conditionally skip tests based on credential availability
tests/PPDS.LiveTests/Infrastructure/LiveTestConfiguration.cs Configuration class reading credentials from environment variables
tests/PPDS.LiveTests/Infrastructure/LiveTestBase.cs Base class and fixture for live integration tests with setup/teardown support
tests/PPDS.Dataverse.IntegrationTests/PPDS.Dataverse.IntegrationTests.csproj New test project using FakeXrmEasy for mocked Dataverse operations
tests/PPDS.Dataverse.IntegrationTests/FakeXrmEasyTestsBase.cs Base class providing FakeXrmEasy context with middleware configuration
tests/PPDS.Dataverse.IntegrationTests/FakeXrmEasySmokeTests.cs Smoke tests verifying FakeXrmEasy infrastructure and CRUD operations
tests/PPDS.Auth.IntegrationTests/PPDS.Auth.IntegrationTests.csproj New test project for authentication flow validation
tests/PPDS.Auth.IntegrationTests/AuthenticationSmokeTests.cs Basic smoke tests for authentication library types
codecov.yml Codecov configuration with component-based coverage targets
PPDS.Sdk.sln Solution file updated with three new test projects
.gitignore Added coverage directory to ignore list
.github/workflows/test.yml Updated to collect XPlat Code Coverage and upload to Codecov
.github/workflows/integration-tests.yml New workflow for running integration tests on trusted PRs
.github/dependabot.yml Added FakeXrmEasy to dependency update groups
.claude/settings.json Refined pre-commit hook matcher and fixed Windows path handling
.claude/hooks/pre-commit-validate.py Simplified logic relying on matcher filtering

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

joshsmithxrm and others added 3 commits January 2, 2026 02:18
- FakeXrmEasyTestsBase: Call Context.Dispose() to prevent resource leak
- LiveDataverseSmokeTests: Fix tautology, improve assertion logic
- LiveDataverseSmokeTests: Remove redundant [Trait] (inherited from base)
- AuthenticationSmokeTests: Remove Integration trait (no external deps)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add section 5 documenting the correct gh api syntax for replying
to individual PR review comments using in_reply_to parameter.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Gemini's suggestion was incorrect - IXrmFakedContext interface doesn't
declare IDisposable. Use safe cast to dispose if runtime type supports it.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
joshsmithxrm and others added 2 commits January 2, 2026 02:36
Update review-bot-comments command to make the process explicit:
1. Fetch and triage comments
2. Present summary with recommendations
3. WAIT for user approval (do NOT auto-implement)
4. Implement approved changes
5. Build and verify before committing
6. Reply to comments

Added warning about bot suggestions being wrong (e.g., Gemini suggested
calling Dispose on an interface that doesn't implement IDisposable).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Rename install-local.ps1 to Install-LocalCli.ps1 (PowerShell Verb-Noun convention)
- Delete ppds-dev.ps1 (trivial wrapper that just called dotnet run)
- Add New-TestCertificate.ps1 for generating Azure App Registration test certificates

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants